package com.example.mapper.institutioncare.jingfeibutie;

import com.example.bean.institutioncare.institutionadmin.Basicdata;
import com.example.bean.institutioncare.jingfeibutie.JingFeiBuTie;
import com.example.bean.institutioncare.jingfeibutie.JingFeiBuTieVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface JingFeiBuTieMapper {
    List jingfeifenye(JingFeiBuTieVo jingFeiBuTieVo);

    @Insert("insert into jingfeibutie(noid,jigou_id,niandu,yingkui,nianduzhengfu,caizhengjingfei,jianshebutie,yunyingbutie,sheshibutie,renyuanbutie,qitabutie,tupian,zongbutie) " +
            "values(replace(uuid(),'-',''),#{jigouId},#{niandu},#{yingkui},#{nianduzhengfu},#{caizhengjingfei},#{jianshebutie},#{yunyingbutie},#{sheshibutie},#{renyuanbutie},#{qitabutie},#{tupian},#{zongbutie})")
    Integer tianjiajingfei(JingFeiBuTie jingFeiBuTie);

    @Select("select * from jingfeibutie where noid = #{noid}")
    JingFeiBuTie jingfeihuixian(String noid);

    @Update("update jingfeibutie set jigou_id = #{jigouId},niandu = #{niandu},yingkui = #{yingkui},nianduzhengfu = #{nianduzhengfu},caizhengjingfei = #{caizhengjingfei},jianshebutie = #{jianshebutie},yunyingbutie = #{yunyingbutie},sheshibutie = #{sheshibutie},renyuanbutie = #{renyuanbutie},qitabutie = #{qitabutie},tupian = #{tupian},zongbutie = #{zongbutie} where noid = #{noid}")
    Integer xiugaijingfei(JingFeiBuTie jingFeiBuTie);

    Integer jingfeishanchu(List<String> ids);

    @Select("select tupian from jingfeibutie where noid = #{noid}")
    List<String> jingfeitupianming(List<String> ids);

    @Select("select noid,jigou_name from t_basicinformation")
    List<Basicdata> jibenbiao();
}
